import request from '@/router/axios'

export function receiveGoodsFetchList(query) {
  return request({
    url: '/eims/inventory/page',
    method: 'get',
    params: query
  })
}
//统计商品数量
export function getGoodsQuantitySum(query) {
  return request({
    url: '/eims/inventory/getGoodsQuantitySum',
    method: 'post',
    data: query
  })
}

// 新增采购收货
export function receiveGoodsAddObj(obj) {
  return request({
    url: '/eims/inventory/savePurchaseInventory',
    method: 'post',
    data: obj
  })
}

// 查询收货单详情
export function receiveGoodsGetObj(id) {
  return request({
    url: '/eims/inventory/' + id,
    method: 'get'
  })
}

//  删除收货单
export function receiveGoodsDelObj(id) {
  return request({
    url: '/eims/inventory/' + id,
    method: 'delete'
  })
}

export function receiveGoodsPutObj(obj) {
  return request({
    url: '/eims/inventory/updatePurchaseInventory',
    method: 'put',
    data: obj
  })
}


export function getInventoryDetailInfo(billId) {
  return request({
    url: '/eims/inventoryDetail/getByBillId/' + billId,
    method: 'get'
  })
}


export function getInventoryDetailList() {
  return request({
    url: '/eims/inventoryDetail/list',
    method: 'get'
  })
}

//	根据收货单ID查询收货单数据
export function checkFormDataById(id,outStockId){
	return request({
		url: '/eims/inventory/getPurchaseInfo/' + id + '/' + outStockId,
		method: 'get'
	})
}

//采购验收接口
export function updateAcceptanceById(obj) {
  return request({
    url: '/eims/inventory/updateAcceptanceById',
    method: 'put',
    data: obj
  })
}